file (This file is an ant script that writes HBM2DDL and Hbm2java tasks, which allows for more flexible management of the project) XML version= "1.0" encoding= "UTF-8"?> 6. Process diagram for execution 7, the result of the execution diagram: Such as. Both Pojo and SQL have been successfully generated. --------------------------------------------------------------------------------------------------------------- --------------------------- In this s
Code in the lastI personally do not like HTTP and JSON, may be the cause of the game, the communication protocol and communication mode is very sensitive, so even for the application I will choose RPC instead of HTTP, but sometimes for various reasons, still do not handle the standard http+json things.This time you do have to deal with a whole bunch of JSON, whic
diagram: For example, both Pojo and SQL have been successfully generated. --------------------------------------------------------------------------------------------------------------- --------------------------- In this special thanks to other seniors for sharing, from his sharing and my groping, let me know how to use Hibernatetools in a Web project Two tools to generate what is needed. Of course, this
Jar packages used in this class: participate in the article "using Json-lib to convert between Java and JSON" reprint "Importjava.util.Collection; ImportJava.util.HashMap; ImportJava.util.Map; ImportNet.sf.json.JSONArray; ImportNet.sf.json.JSONObject; /*** Pojo conversion between J
Android Json uses jsonschema2pojo to generate a. java FileSummary
How to quickly develop android applications with json. Defining specific java beans corresponding to json by yourself. parsing
-------------------- Reprint Please specify:http://blog.csdn.net/feiduclear_up/article/details/42499409ProfileHow to quickly develop an Android app with JSON. It is a chore to define JSON-specific Java beans and parse JSON with the JSON library that comes with Android. So he
Jsonobject = Jsonobject.fromobject (JSON);UserBean bean = (UserBean) Jsonobject.tobean (Jsonobject, Userbean.class);System.out.println (Jsonobject);Theoretically, this would be possible, but when there was an anomaly caused by:java.lang.nosuchmethodexception:com.json.json$userbean.3.JSONArray to List String json = "[\" first\ ", \" second\ "]";Jsonarray Jsonarray = (jsonarray) Jsonserializer.tojson (
Automatically generate model classes based on JSONJavaConvert JSON to Java class http://jsongen.byingtondesign.com you bring the JSON, we'll bring the codeFind a great site that can directly generate a JSON string into the
java.io.Serializable { private Integer stuid; private String stunetname; private String Stupassword; private String sturealname; private String stuemail; private String stuimg; private String stuinfo; ..} The overall step is not too cumbersome, if the table is more, you can save a lot of development effort. After you have designed the table structure, you can generate a primary version of the Java
, the Po and Vo, their relationship should be independent of each other, a VO can be just a PO part, also can be a number of PO composition, the same can also be equated to a PO (of course I refer to their attributes). Because of this, the PO is independent, the data persistence layer is independent, it will not be interfered by any business. Because of this, the business logic layer is also independent, it will not be affected by the data persistence layer, the business layer is only concerned
course I mean their attributes ). As a result, the PO is independent, and the data persistence layer is independent, so it is not subject to any business interference. In this case, the business logic layer is also independent and will not be affected by the data persistence layer. The business layer only cares about the processing of the business logic. As for how to read and give it to others! However, if we do not use the data persistence layer or hibernate, Po and VO can be the same thing,
/set method, but for hibernate, this requires special attention, because hibernate from the database read data to do, is to use the reflection mechanism to call do the empty argument constructor to construct a do instance, Then using the JavaBean specification to reflect the set method to set a value for each property, if you do not explicitly declare the set method, or set method to private, will cause hibernate to fail to initialize do, resulting in a run-time exception, It is advisable to set
The Java (Po,vo,to,bo,dao,POJO) explanation for the O/R Mapping is an abbreviation for Object Relational Mapping ( the Objects relational map). The popular point is that the object is bound to the relational database, and the object is used to represent the relational data. In the world of O/R Mapping, there are two basic and important things to understand, namely Vo,po. VO, a Value object, a PO, a pe
Po (persistant object) Persistent ObjectThe concept that appears during o/R ing does not exist if there is no o/R ing. usually it corresponds to the data model (database), and some business logic is processed. it can be seen as a Java object mapped to tables in the database. the simplest Po is to correspond to a record in a table in the database. A set of PO can be used for multiple records. the PO should not contain any database operations.
VO (Val
POJO is the most common and variable object. It is an intermediate object and the most common object to deal.After a POJO is persisted, it is the POIt is DTO in the process of passing and passing.Directly used to correspond to the presentation layer is VODAO:Data access objectThis person is the most familiar with it. It is the most different from the previous O, and there is basically no possibility or nee
one, PO:(persistant object), Persistent objectsCan be seen as a Java object mapped to a table in the Database. Using hibernate to generate a PO is a good choice.second, VO:(value object), value ObjectsTypically used for data transfer between business tiers, as is the case with po, which contains only Data. But it should be abstracted out of business objects that can correspond to tables, or not, depending o
One, PO:(persistant object), persistent objectsCan be seen as a Java object mapped to a table in the database. Using hibernate to generate a PO is a good choice.Second, VO:(value object), Value objectsTypically used for data transfer between business tiers, as is the case with PO, which contains only data. But it should be abstracted out of business objects that can correspond to tables, or not, depending o
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.